(function (define) {
    define([''], function () {
        var RoutingConf = function ($sceDelegateProvider, $routeProvider, $locationProvider, RestangularProvider) {
            var baseURL = cs3382Dir + '/js/src/3382/';

            $sceDelegateProvider.resourceUrlWhitelist([
                'self', baseURL + '**'
            ]);

            if($("html").hasClass("ie8") || $("html").hasClass("ie9"))
                $locationProvider.html5Mode(false);
            else
                $locationProvider.html5Mode(true);

            $routeProvider
                .when(cs3382Dir + '/public-duty', {templateUrl: baseURL + 'Page/templates//public-duty.tpl.html'})
                .when(cs3382Dir + '/public-duty/paper-reviewers', {templateUrl: baseURL + 'Page/templates/paper-reviewers.tpl.html'})

                .when(cs3382Dir + '/awards', {templateUrl: baseURL + 'Page/templates/awards.tpl.html'})
                .when(cs3382Dir + '/courses-offered', {templateUrl: baseURL + 'Page/templates/courses-offered.tpl.html'})

                .when(cs3382Dir + '/fellow-students', {templateUrl: baseURL + 'Page/templates/fellow-students.tpl.html'})
                .when(cs3382Dir + '/fellow-students/doctorial', {templateUrl: baseURL + 'Page/templates/doctorial.tpl.html'})
                .when(cs3382Dir + '/fellow-students/master', {templateUrl: baseURL + 'Page/templates/master.tpl.html'})

                .when(cs3382Dir + '/fyp', {templateUrl: baseURL + 'Page/templates/fyp.tpl.html'})
                .when(cs3382Dir + '/motion-lab', {templateUrl: baseURL + 'Page/templates/motion-lab.tpl.html'})
                .when(cs3382Dir + '/research-projects', {templateUrl: baseURL + 'Page/templates/research-projects.tpl.html'})

                .when(cs3382Dir + '/publications', {templateUrl: baseURL + 'Page/templates/publications.tpl.html'})
                .when(cs3382Dir + '/publications/conference', {templateUrl: baseURL + 'Page/templates/conference.tpl.html'})
                .when(cs3382Dir + '/publications/editorship', {templateUrl: baseURL + 'Page/templates/editorship.tpl.html'})
                .when(cs3382Dir + '/publications/journal', {templateUrl: baseURL + 'Page/templates/journal.tpl.html'})
                .when(cs3382Dir + '/', {templateUrl: baseURL + 'Page/templates/about.tpl.html'})

                .otherwise({
                    redirectTo: cs3382Dir + '/'
                });

            RestangularProvider.setBaseUrl(cs3382Dir + '/api');
        }
        return [ "$sceDelegateProvider", "$routeProvider", "$locationProvider", "RestangularProvider", RoutingConf ];
    });
})(define);